<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<%@ include file="../bui_header.jsp" %>

<body>

<div class="container">
    <div class="row">
      <form id="searchForm" class="form-horizontal span24">
        
        <div class="row">
          <div class="control-group span8">
            <label class="control-label">公司名称：</label>
            <div class="controls">
              <input type="text" class="text" name="company_name">
            </div>
          </div>
          <div class="control-group span8">
            <label class="control-label">所属年度：</label>
            <div class="controls">
              <input type="text" class="text" name="belong_year">
            </div>
          </div>
          <div class="span4">
            <button type="button" id="btnSearch" class="button button-primary">搜索</button>
          </div>
        </div>
      </form>
    </div>
    <div class="search-grid-container">
      <div id="grid"></div>
    </div>

  </div>
  
<script type="text/javascript">
BUI.use(['common/search', 'bui/overlay', 'common/page'], function (Search, Overlay) {
    
    var columns = [
	        {title:'企业名称', 	dataIndex:'companyName', 		width:'20%',
	        	renderer: function (val, obj) {
	                return Search.createLink({
	                    id : 'zmgs_detail_' + obj.number,
	                    title : '知名公司查询详情',
	                    text : val,
	                    href : '<%=contextPath %>/report/zmgs/detail.do?comName=' + obj.companyName
	            	});
	        	}
	        },
	        {title:'注册资本（万元）', dataIndex:'registerFund',  width:'12%',
	        	renderer: function(value, obj) {
	        		return value + "（￥）";
	        	}},
	        {title:'成立时间', 	dataIndex:'establishDate', 		width:'10%'},
	        /* {title:'行业类别', 	dataIndex:'businessType',		width:'10%'}, */
	        {title:'企业类别', 	dataIndex:'companyType',		width:'10%'},
	        {title:'注册地', 		dataIndex:'registerAddress',	width:'30%'},
	        {title:'基础资料分', 	dataIndex:'baseScore',	 		width:'10%'}, 
	        {title:'业务发展评分', 	dataIndex:'bizScore', 			width:'10%'}, 
	        {title:'媒体评价分数', 	dataIndex:'mediaScore', 		width:'10%'}, 
	        {title:'获奖评价分数', 	dataIndex:'bearScore', 		 	width:'10%'},
	        {title:'总分', 		dataIndex:'sumScore', 			width:'10%'}
      ];
      var store = Search.createStore('<%=contextPath %>/report/zmgs/getdata.do', {
    	  autoSync: true,
    	  proxy: {
      		method: "post",
      		dataType : 'json'
    	  }
      });
      
      var height = $(window).height() - 70;
      var gridCfg = Search.createGridCfg(columns, {
    	  height: height,
    	  //width:'200%',
    	  bbar : {pagingBar : true}
      });

    var search = new Search({
        store : store,
        gridCfg : gridCfg
      });
    var grid = search.get('grid');
    ss();
  });
function ss() {
	var $grid = $(".bui-grid");
	if (!$grid)
		  return ;
	var $gridBody = $grid.find(".bui-grid-body");
	if (!$gridBody)
		  return ;
	$gridBody.css('overflow-y', 'auto');
  
  var $gridTable = $grid.find(".bui-grid-table");
  if ($gridTable)
	  $gridTable.width($gridBody.width()); 
}
</script>

		
</body>
</html>